<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>退费明细管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="退费,明细,管理">
	<meta http-equiv="description" content="This is my page">

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="refundDetailManage.action" namespace="/inner/charge">
    		<div id="listDiv">
	    		<s:hidden name="rvo.refund.id" id="refundId"></s:hidden>
	    		<s:hidden name="refund.child.id" id="childId"></s:hidden>
	    		
	    		<table cellspacing="0" width="100%">
					<tr>
						<td align="left">
							<my:hasPermission privilegeId="toAddRefundDetail">
							<input type="button" value="新增" class="btn" onclick="addRefundDetail()"/>
							</my:hasPermission>
							<my:hasPermission privilegeId="delRefundDetail">
							<input type="button" value="删除" class="btn" onclick="delRefundDetail()"/>
							</my:hasPermission>
						</td>
					</tr>
				</table>
	    		
	    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
	    			<tr class="tableHead" align="center">
	    				<td width="10%">
	    					<input type="checkbox" onclick="cbCheck(this, 'rfIds')" />
	    				</td>
	    				<td width="10%">
	    					序号
	    				</td>
	    				<td width="18%">
	    					指标
	    				</td>
	    				<td width="18%">
	    					费用所属年月
	    				</td>
	    				<td width="18%">
	    					退费金额(￥)
	    				</td>
	    				<td width="26%">
	    					备注
	    				</td>
	    			</tr>
	    			<s:iterator value="lp.list" status="s">
	    				<tr align="center"
	    					<s:if test="#s.index%2==0">class="tableRow2" onMouseMove="this.className='tableRow3'" onMouseOut="this.className='tableRow2'"</s:if>
							<s:else>class="tableRow1" onMouseMove="this.className='tableRow3'" onMouseOut="this.className='tableRow1'"</s:else>
	    				>
	    					<td>
	    						<input name="rfIds" type="checkbox" value="<s:property value='id' />" />
	    					</td>
	    					<td>
	    						<s:property value="(pager.thisPage - 1) * pager.pageSize + #s.index + 1" />
	    					</td>
	    					<td>
	    						<s:property value="indexName"/>
	    					</td>
	    					<td>
	    						<s:date name="chargeDate" format="yyyy-MM"/>
	    					</td>
	    					<td>
	    						<s:property value="intAmount"/>
	    					</td>
	    					<td>
	    						<s:property value="remark"/>
	    					</td>
	    				</tr>
	    			</s:iterator>
	    			<jsp:include page="/common/pager/pager.jsp">
						<jsp:param name="formName" value="frm" />
						<jsp:param name="id" value="1" />
					</jsp:include>
	    		</table>
	    	</div>
    	</s:form>
    </center>
    
    <script type="text/javascript">
    $(function(){
    	var detailFrame = parent.$('#detailFrame');
		var listDiv = $('#listDiv');
		if(detailFrame.length > 0)
		{
			detailFrame.height(listDiv.height() + 20);
		}
    });
    
    function delRefundDetail()
    {
        if(hasCheck('rfIds') == false)
            return;
    	showConfirm('确认删除？', function(v){
    		if(v == true)
    		{
    			var url = 'inner/charge/delRefundDetail.action';
    			ajaxAction(url, 'post', 'frm', false, function(){
        			searchThis();
        		});
    		}
    	});
    }

    function addRefundDetail()
    {
        var childId = $('#childId');
        var refundId = $('#refundId');
    	var url = realPath + '/inner/charge/tuitionAndDetail.action?tdvo.childId=' + childId.val();
    	var id = showMd(url, 800, 500, 'yes', 'yes');
    	if(isNotNull(id))
    	{
    		var addUrl = realPath + '/inner/charge/toAddRefundDetail.action?tuitionDetail.id=' + id + '&refundDetail.refund.id=' + refundId.val();
    		var id = showMd(addUrl, 450, 300, 'yes', 'yes');
    	}
    }

    function searchThis()
    {
    	$('#thisPage').val(1);
    	$('#frm').submit();
    }
    </script>
  </body>
</html>
